
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>新建插件 · ZanProxy</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="manager.html" />
    
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../../">
            
                <a href="../../../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../../../quick-start/">
            
                <a href="../../../quick-start/">
            
                    
                    快速开始
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../../../quick-start/pre-install.html">
            
                <a href="../../../quick-start/pre-install.html">
            
                    
                    前置条件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../../../quick-start/install.html">
            
                <a href="../../../quick-start/install.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="../../../quick-start/launch.html">
            
                <a href="../../../quick-start/launch.html">
            
                    
                    启动
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="../../../quick-start/cert.html">
            
                <a href="../../../quick-start/cert.html">
            
                    
                    证书安装
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../../../configure/">
            
                <a href="../../../configure/">
            
                    
                    代理配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../../../configure/host.html">
            
                <a href="../../../configure/host.html">
            
                    
                    Host管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../../../configure/rule.html">
            
                <a href="../../../configure/rule.html">
            
                    
                    转发规则
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../../../configure/project.html">
            
                <a href="../../../configure/project.html">
            
                    
                    工程路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../../../configure/mock.html">
            
                <a href="../../../configure/mock.html">
            
                    
                    mock数据
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../../../usage/">
            
                <a href="../../../usage/">
            
                    
                    使用代理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../../../usage/chrome.html">
            
                <a href="../../../usage/chrome.html">
            
                    
                    chrome代理配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../../../usage/mobile.html">
            
                <a href="../../../usage/mobile.html">
            
                    
                    手机代理设置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../../../usage/enable.html">
            
                <a href="../../../usage/enable.html">
            
                    
                    规则启用/禁用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../../../usage/monitor.html">
            
                <a href="../../../usage/monitor.html">
            
                    
                    请求监控
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../../../plugin/">
            
                <a href="../../../plugin/">
            
                    
                    自定义插件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../../../plugin/code.html">
            
                <a href="../../../plugin/code.html">
            
                    
                    编写插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../../../plugin/usage.html">
            
                <a href="../../../plugin/usage.html">
            
                    
                    使用插件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../../">
            
                <a href="../../">
            
                    
                    Mac 客户端
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../../use.html">
            
                <a href="../../use.html">
            
                    
                    使用方式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../">
            
                <a href="../">
            
                    
                    插件开发
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.2.1" data-path="../directory.html">
            
                <a href="../directory.html">
            
                    
                    目录结构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.2" data-path="../architecture.html">
            
                <a href="../architecture.html">
            
                    
                    项目架构
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.3" data-path="../type-system.html">
            
                <a href="../type-system.html">
            
                    
                    类型系统
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.4" >
            
                <span>
            
                    
                    插件开发指南
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter active" data-level="1.6.2.4.1" data-path="start.html">
            
                <a href="start.html">
            
                    
                    新建插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.4.2" data-path="manager.html">
            
                <a href="manager.html">
            
                    
                    Manager
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.4.3" data-path="renderer.html">
            
                <a href="renderer.html">
            
                    
                    Renderer
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.2.5" >
            
                <span>
            
                    
                    API参考
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.2.5.1" data-path="../api/main.html">
            
                <a href="../api/main.html">
            
                    
                    Main
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.5.2" data-path="../api/renderer.html">
            
                <a href="../api/renderer.html">
            
                    
                    Renderer
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../../../cooperation/">
            
                <a href="../../../cooperation/">
            
                    
                    团队协作
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../../../cooperation/remoteRule.html">
            
                <a href="../../../cooperation/remoteRule.html">
            
                    
                    远程规则
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../.." >新建插件</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x63D2;&#x4EF6;&#x7684;&#x76EE;&#x5F55;">&#x63D2;&#x4EF6;&#x7684;&#x76EE;&#x5F55;</h2>
<p>&#x6211;&#x4EEC;&#x5148;&#x6765;&#x770B;&#x4E00;&#x4E2A; Counter &#x63D2;&#x4EF6;&#x7684;&#x76EE;&#x5F55;&#x7ED3;&#x6784;</p>
<pre><code class="lang-shell">src/plugins/counter
&#x251C;&#x2500;&#x2500; index.d.ts          # &#x8BE5;&#x63D2;&#x4EF6;&#x7684;&#x7C7B;&#x578B;&#x5B9A;&#x4E49;&#x6269;&#x5C55;&#xFF08;&#x5FC5;&#x9700;&#xFF09;
&#x251C;&#x2500;&#x2500; common              # &#x63D2;&#x4EF6;&#x7684; main &#x8FDB;&#x7A0B;&#x548C; renderer &#x8FDB;&#x7A0B;&#x516C;&#x7528;&#x6587;&#x4EF6;&#xFF08;&#x53EF;&#x9009;&#xFF09;
&#x2502;   &#x2514;&#x2500;&#x2500; constants.ts
&#x251C;&#x2500;&#x2500; manager             # &#x63D2;&#x4EF6;&#x7684; main &#x8FDB;&#x7A0B;&#x76EE;&#x5F55;&#xFF08;&#x5FC5;&#x9700;&#xFF09;
&#x2502;   &#x2514;&#x2500;&#x2500; index.ts        # &#x63D2;&#x4EF6;&#x7684; main &#x8FDB;&#x7A0B;&#x5165;&#x53E3;&#x6587;&#x4EF6;
&#x2514;&#x2500;&#x2500; renderer            # &#x63D2;&#x4EF6;&#x7684; renderer &#x8FDB;&#x7A0B;&#x76EE;&#x5F55;&#xFF08;&#x53EF;&#x9009;&#xFF09;
    &#x251C;&#x2500;&#x2500; api.ts
    &#x251C;&#x2500;&#x2500; components
    &#x2502;   &#x2514;&#x2500;&#x2500; editor-field
    &#x2502;       &#x2514;&#x2500;&#x2500; index.tsx
    &#x251C;&#x2500;&#x2500; index.ts        # &#x63D2;&#x4EF6;&#x7684; renderer &#x8FDB;&#x7A0B;&#x5165;&#x53E3;&#x6587;&#x4EF6;
    &#x2514;&#x2500;&#x2500; init.ts
</code></pre>
<p>&#x53EF;&#x4EE5;&#x770B;&#x51FA;&#xFF0C;&#x4E00;&#x4E2A; zan-proxy-mac &#x63D2;&#x4EF6;&#x7684;&#x6784;&#x6210;&#x5206;&#x4E3A; &#x7C7B;&#x578B;&#x5B9A;&#x4E49;&#x3001;manager&#x3001;renderer &#x4E09;&#x4E2A;&#x90E8;&#x5206;&#xFF0C;&#x5176;&#x4E2D;&#x7C7B;&#x578B;&#x5B9A;&#x4E49;&#x548C; manager &#x4E3A;&#x4E3A;&#x5FC5;&#x987B;&#x7684;&#xFF0C;&#x800C;&#x5982;&#x679C;&#x4E0D;&#x9700;&#x8981;&#x5BF9; renderer &#x8FDB;&#x7A0B;&#x7684;&#x9875;&#x9762;&#x5185;&#x5BB9;&#x8FDB;&#x884C;&#x6269;&#x5C55;&#xFF0C;&#x5219;&#x4E0D;&#x9700;&#x8981;&#x521B;&#x5EFA; renderer &#x76EE;&#x5F55;&#x3002;</p>
<h3 id="&#x63D2;&#x4EF6;&#x7684;&#x540D;&#x79F0;">&#x63D2;&#x4EF6;&#x7684;&#x540D;&#x79F0;</h3>
<p>zan-proxy-mac &#x5C06;&#x63D2;&#x4EF6;&#x6240;&#x5728;&#x7684;&#x76EE;&#x5F55;&#x540D;&#x79F0;&#x5F53;&#x505A;&#x63D2;&#x4EF6;&#x7684;&#x540D;&#x79F0;&#xFF0C;&#x56E0;&#x6B64;&#x5728;&#x7C7B;&#x578B;&#x5B9A;&#x4E49;&#x4E2D;&#x58F0;&#x660E; manager &#x548C;&#x5728;&#x63D2;&#x4EF6;&#x7684; renderer &#x4E2D;&#x8BBE;&#x7F6E;&#x6302;&#x8F7D;&#x5BF9;&#x8C61;&#x540D;&#x79F0;&#xFF08;&#x53C2;&#x8003;<a href="renderer.html#&#x6302;&#x8F7D;&#x5BF9;&#x8C61;">&#x63D2;&#x4EF6;&#x7684;Renderer&#x4ECB;&#x7ECD;</a>&#xFF09;&#x65F6;&#xFF0C;&#x9700;&#x8981;&#x4EE5;&#x76EE;&#x5F55;&#x540D;&#x4E3A;&#x51C6;&#x3002;</p>
<h3 id="&#x5982;&#x4F55;&#x542F;&#x7528;&#x6216;&#x505C;&#x7528;&#x63D2;&#x4EF6;">&#x5982;&#x4F55;&#x542F;&#x7528;&#x6216;&#x505C;&#x7528;&#x63D2;&#x4EF6;</h3>
<p>&#x63D2;&#x4EF6;&#x7684;&#x542F;&#x7528;&#x548C;&#x505C;&#x7528;&#x662F;&#x7531; <code>config.ts</code> &#x6587;&#x4EF6;&#x4E2D; export &#x7684; plugins &#x5BF9;&#x8C61;&#x6765;&#x63A7;&#x5236;&#x7684;&#xFF0C;&#x82E5;&#x60F3;&#x8981;&#x542F;&#x52A8;&#x63D2;&#x4EF6;&#xFF0C;&#x5219;&#x53EA;&#x9700;&#x8981;&#x5C06;&#x63D2;&#x4EF6;&#x540D;&#x79F0;&#x6DFB;&#x52A0;&#x5230; plugins &#x5BF9;&#x8C61;&#x4E2D;&#x5373;&#x53EF;&#xFF1B;&#x53CD;&#x4E4B;&#xFF0C;&#x5C06;&#x63D2;&#x4EF6;&#x540D;&#x79F0;&#x4ECE; plugins &#x5BF9;&#x8C61;&#x4E2D;&#x5220;&#x53BB;&#xFF0C;&#x5373;&#x53EF;&#x505C;&#x7528;&#x8BE5;&#x63D2;&#x4EF6;&#x3002;</p>
<h3 id="&#x7F16;&#x5199;&#x63D2;&#x4EF6;&#x5185;&#x5BB9;">&#x7F16;&#x5199;&#x63D2;&#x4EF6;&#x5185;&#x5BB9;</h3>
<ol>
<li><a href="manager.html">Plugin-Manager &#x7F16;&#x5199;&#x6307;&#x5357;</a></li>
<li><a href="renderer.html">Plugin-Renderer &#x7F16;&#x5199;&#x6307;&#x5357;</a></li>
</ol>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                
                <a href="manager.html" class="navigation navigation-next navigation-unique" aria-label="Next page: Manager">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"新建插件","level":"1.6.2.4.1","depth":4,"next":{"title":"Manager","level":"1.6.2.4.2","depth":4,"path":"gui/plugin/plugin-guide/manager.md","ref":"gui/plugin/plugin-guide/manager.md","articles":[]},"previous":{"title":"插件开发指南","level":"1.6.2.4","depth":3,"ref":"","articles":[{"title":"新建插件","level":"1.6.2.4.1","depth":4,"path":"gui/plugin/plugin-guide/start.md","ref":"gui/plugin/plugin-guide/start.md","articles":[]},{"title":"Manager","level":"1.6.2.4.2","depth":4,"path":"gui/plugin/plugin-guide/manager.md","ref":"gui/plugin/plugin-guide/manager.md","articles":[]},{"title":"Renderer","level":"1.6.2.4.3","depth":4,"path":"gui/plugin/plugin-guide/renderer.md","ref":"gui/plugin/plugin-guide/renderer.md","articles":[]}]},"dir":"ltr"},"config":{"plugins":[],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":false,"twitter":false,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":[]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"ZanProxy","links":{"gitbook":false,"sharing":{"google":false,"facebook":false,"twitter":false,"all":false}},"gitbook":"*"},"file":{"path":"gui/plugin/plugin-guide/start.md","mtime":"2019-03-08T06:06:12.816Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-03-08T06:08:21.743Z"},"basePath":"../../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../../gitbook/gitbook.js"></script>
    <script src="../../../gitbook/theme.js"></script>
    
        
        <script src="../../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

